/*
 * @Author: your name
 * @Date: 2019-10-21 14:27:24
 * @LastEditTime: 2019-11-05 12:56:20
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /c:\Users\DELL\Desktop\zhhu\app\controllers\Home.js
 */
const  path=require('path')
class HomeCtr {
   async index(ctx,next){
        ctx.body=`<h1>这是主页信息</h1>`
    }
    async upload(ctx,next){
        const file = ctx.request.files.file;
        const baseName=path.basename(file.path)
        console.log(ctx.origin)
        ctx.body= {url:`${ctx.origin}/uploads/${baseName}`};
    }
}
module.exports=new HomeCtr();